<?php
/* 
* @Author: LDF QQ 47121862
* @Date:   2014-06-06 10:04:19
* @Last Modified by:   LDF QQ 47121862
* @Last Modified time: 2014-06-06 10:36:55
*/
class OrderControl extends AuthControl{
	//订单列表
	function index(){
		$this->order=M('order')->all();
		$this->display();
	}
	//修改订单
	function edit(){
		// echo 1;die;
		$oid=Q('oid',0,'intval');
		$stat=(Q('stat',0,'intval')+1)>8?8:(Q('stat',0,'intval')+1);
		$id=M('order')->save(array('oid'=>$oid,'stat'=>$stat));
		$id?1:0;
		echo $id;die;
		// $id?$this->success('修改状态成功'):$this->error('修改失败');
	}
	//删除订单
	function del(){
		$id = M('order')->del(array('oid'=>Q('oid',0,'intval')));
		$id?$this->success('删除订单成功'):$this->error('删除失败');
	}
}
